﻿Public Class CPUuserControl

    Dim cpu As Integer
    Dim ram As Integer


    Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click

    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Timer1.Enabled = True
    End Sub

    Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        cpu = PerformanceCounter1.NextValue
    End Sub

    Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick

        If ProgressBar1.Value < cpu Then
            ProgressBar1.Value += 1
        ElseIf ProgressBar1.Value > cpu Then
            ProgressBar1.Value -= 1
        End If



        Label3.Text = ProgressBar1.Value.ToString + "%"

    End Sub

    Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged

    End Sub

End Class
